package com.fml.dataStructure.sort;

import com.fml.dataStructure.sort.util.SortUtils;

public class MaopaoSort {


    //冒泡排序  双循环暴力排序,从小到大
    public int[] maopaoSort() {
        int[] sort = new int[]{9, 1, 3, 2, 5, 6, 8, 10, 12, 4, 0, 7};

        int temp = sort[0];
        for (int i = 0; i < sort.length; i++) {
            for (int j = 0; j < sort.length - 1; j++) {

                if (sort[j] > sort[j + 1]) {
                    SortUtils.swap(sort, j, j + 1);
                }
            }
        }
        return sort;
    }

}
